package com.lib.dto.enums;

/**
 * Created by duqingxiang on 17/5/25.
 */
public enum CustomerErrorEnum {

    REPEAT_REQUEST(-1, "wxMessage/customer/error/repeat_request.ftl"),
    AGENT_UNEXIST(-1, "wxMessage/customer/error/agent_unexist.ftl");

    private int key;

    private String template;

    CustomerErrorEnum(int key, String template) {
        this.key = key;
        this.template = template;
    }

    public int getKey() {
        return key;
    }

    public void setKey(int key) {
        this.key = key;
    }

    public String getTemplate() {
        return template;
    }

    public void setTemplate(String template) {
        this.template = template;
    }

    public static CustomerErrorEnum valuesOf(int key){
        for (CustomerErrorEnum error : values()) {
            if (error.getKey() == key) {
                return error;
            }
        }
        return null;
    }
}
